package string;

/**
 * boolean startWith(String str)
 * boolean endWith(String str)
 * 判断字符串是否是以给定的内容开始或结束的
 */
public class StartWithDemo {
    public static void main(String[] args) {
        String line = "www.tedu.cn";
        boolean starts = line.startsWith("www");
        System.out.println("start:"+starts);

        boolean ends = line.endsWith(".com");
        System.out.println("end:"+ends);
    }
}
